package mysql

import "gorm.io/gorm"

type Shop struct {
	gorm.Model
	Name   string  `gorm:"type:varchar(30);not null;comment:商品名称"`
	Price  float64 `gorm:"type:decimal(10,2);not null;comment:价格"`
	Number int     `gorm:"type:int(11);not null;comment:数量"`
}
type User struct {
	gorm.Model
	Account  string `gorm:"type:varchar(30);not null;comment:账号"`
	Password string `gorm:"type:char(32);not null;comment:密码"`
}

func (s *Shop) FindShopId(id int) error {
	return DB.Where("id=?", id).First(&s).Error
}
